const { imgPath } = require("./data/config");
let { dycalendarDom } = require("./dycalendar");
let { tools } = require("./utils/util");

let promiseList = [];
// let taskbar = document.createElement('div');
// taskbar.classList.add('taskbar');
let taskbar = tools.myCreateElement('taskbar', 'div');
let left = tools.myCreateElement('left', 'div');
let right = tools.myCreateElement('right', 'div');

let winBtn = document.createElement('div');
let winBtnImg = document.createElement('img');
winBtn.classList.add('winBtn');
winBtnImg.src = imgPath + '/assets/image/svg/win11.svg';
promiseList.push(new Promise((resolve, reject) => {
    winBtnImg.onload = function (e) {
        resolve();
    };
}));
right.append(dycalendarDom());
// setTimeout(()=>{i=2},10000)
Promise.all(promiseList).then(res => {
    taskbar.append(left);
    winBtn.append(winBtnImg);
    taskbar.append(winBtn);
    taskbar.append(right);
});


exports.taskbarDom = taskbar;